FROM uhub.service.ucloud.cn/keyleaf/alpine-java:8_server-jre_unlimited

MAINTAINER keyleaf

COPY fonts/* /usr/share/fonts/chinese/

RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories  \
    && apk update && apk upgrade  \
    && apk add --no-cache curl libreoffice \
    && fc-cache -fv

RUN mkdir -p /workdir

WORKDIR /workdir

ENV SERVER_PORT=8080
ENV JAR_NAME=demo.jar

EXPOSE ${SERVER_PORT}

ADD ./target/document-demo-0.0.1-SNAPSHOT.jar ./demo.jar

ENTRYPOINT ["sh", "-c", "java -Dserver.port=${SERVER_PORT} -jar ${JAR_NAME}"]
